/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package utn.frsf.cidisi.upcolbpip.interactionprotocols.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import utn.frsf.cidisi.upcolbpip.interactionprotocols.Correlation;
import utn.frsf.cidisi.upcolbpip.interactionprotocols.InteractionprotocolsPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Correlation</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link utn.frsf.cidisi.upcolbpip.interactionprotocols.impl.CorrelationImpl#getProtocolElement <em>Protocol Element</em>}</li>
 *   <li>{@link utn.frsf.cidisi.upcolbpip.interactionprotocols.impl.CorrelationImpl#getSubProtocoloElement <em>Sub Protocolo Element</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class CorrelationImpl extends EObjectImpl implements Correlation {
	/**
	 * The default value of the '{@link #getProtocolElement() <em>Protocol Element</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getProtocolElement()
	 * @generated
	 * @ordered
	 */
	protected static final String PROTOCOL_ELEMENT_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getProtocolElement() <em>Protocol Element</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getProtocolElement()
	 * @generated
	 * @ordered
	 */
	protected String protocolElement = PROTOCOL_ELEMENT_EDEFAULT;

	/**
	 * The default value of the '{@link #getSubProtocoloElement() <em>Sub Protocolo Element</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSubProtocoloElement()
	 * @generated
	 * @ordered
	 */
	protected static final String SUB_PROTOCOLO_ELEMENT_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getSubProtocoloElement() <em>Sub Protocolo Element</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSubProtocoloElement()
	 * @generated
	 * @ordered
	 */
	protected String subProtocoloElement = SUB_PROTOCOLO_ELEMENT_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CorrelationImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return InteractionprotocolsPackage.Literals.CORRELATION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getProtocolElement() {
		return protocolElement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setProtocolElement(String newProtocolElement) {
		String oldProtocolElement = protocolElement;
		protocolElement = newProtocolElement;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, InteractionprotocolsPackage.CORRELATION__PROTOCOL_ELEMENT, oldProtocolElement, protocolElement));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getSubProtocoloElement() {
		return subProtocoloElement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSubProtocoloElement(String newSubProtocoloElement) {
		String oldSubProtocoloElement = subProtocoloElement;
		subProtocoloElement = newSubProtocoloElement;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, InteractionprotocolsPackage.CORRELATION__SUB_PROTOCOLO_ELEMENT, oldSubProtocoloElement, subProtocoloElement));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case InteractionprotocolsPackage.CORRELATION__PROTOCOL_ELEMENT:
				return getProtocolElement();
			case InteractionprotocolsPackage.CORRELATION__SUB_PROTOCOLO_ELEMENT:
				return getSubProtocoloElement();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case InteractionprotocolsPackage.CORRELATION__PROTOCOL_ELEMENT:
				setProtocolElement((String)newValue);
				return;
			case InteractionprotocolsPackage.CORRELATION__SUB_PROTOCOLO_ELEMENT:
				setSubProtocoloElement((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case InteractionprotocolsPackage.CORRELATION__PROTOCOL_ELEMENT:
				setProtocolElement(PROTOCOL_ELEMENT_EDEFAULT);
				return;
			case InteractionprotocolsPackage.CORRELATION__SUB_PROTOCOLO_ELEMENT:
				setSubProtocoloElement(SUB_PROTOCOLO_ELEMENT_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case InteractionprotocolsPackage.CORRELATION__PROTOCOL_ELEMENT:
				return PROTOCOL_ELEMENT_EDEFAULT == null ? protocolElement != null : !PROTOCOL_ELEMENT_EDEFAULT.equals(protocolElement);
			case InteractionprotocolsPackage.CORRELATION__SUB_PROTOCOLO_ELEMENT:
				return SUB_PROTOCOLO_ELEMENT_EDEFAULT == null ? subProtocoloElement != null : !SUB_PROTOCOLO_ELEMENT_EDEFAULT.equals(subProtocoloElement);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (protocolElement: ");
		result.append(protocolElement);
		result.append(", subProtocoloElement: ");
		result.append(subProtocoloElement);
		result.append(')');
		return result.toString();
	}

} //CorrelationImpl
